package com.tools.cleanmaster.cpucool;


import com.tools.cleanmaster.taskmain.ProcessItem;

import java.util.List;

/**
 * Created by wangguotao on 15/8/28.
 */
public interface CpuCoolInterface {

    //没有使用过CPU加速
    int CPU_TEMP_STATE_FIRST = 0;
    //已经使用过CPU加速
    int CPU_TEMP_STATE_NORMAL = 1;
    //CPU加速在保护时间内
    int CPU_TEMP_STATE_PROTECT = 2;
    //CPU温度异常过高
    int CPU_TEMP_STATE_EXCEPTION = 3;

    /*
 * 界面实现的listener
 */
    interface GetCpuTempListener {
        /*
         * 获取cpu温度完成
         */
        void onGetCpuTempDone(CpuTempInfo info);

        /*
         * cpu降温完成
         */
        void onMakeCpuCoolDone(double coolTemp, double lastCoolTemp);
    }

    void addListener(GetCpuTempListener listener);

    void removeListener(GetCpuTempListener listener);

    CpuTempInfo startGetCpuTempSync(boolean haveIcon, boolean isUpdate);

    void startGetCpuTempAsync(boolean haveIcon, boolean isUpdate);

    void startCpuCoolSync(List<ProcessItem> items);

    void startCpuCoolAsync(List<ProcessItem> items);

    boolean isInProtectTime();

    int getLastOptimizerTemp();

    int getLastTemp();

    int getCpuTempState();

    String getCpuCoolLastTime();
}
